<{import file="index/header.html" title="收货地址"}>
<style type="text/css"> 
.addtab{ width:1880px; border-bottom:none; padding:0 0 12px 0; float:left; }
.addtab a{ border:1px solid #ddd; padding:7px 25px; font-size:12px; border-radius:1px; font-weight:100; background:#f8f8f8; color:#333; float:left; }
a.edit_font{ margin:0 12px 0 0; float:left; }
</style> 
<div class="lbox">
	<div class="addtab"> 
		<a href="javascript:;" onClick="edit_address('添加需求','member.php?m=xuq&a=edit')" id="add_xuq">添加需求</a>
	</div>
	<table class="ltable">
		<thead>
			<tr>
				<th width="70">标题</th>
				<th width="110">分类</th>
				<th>规格</th>
				<th width="100">发布时间</td>
				<th width="80">投标人数</th>
				<th width="80">投标状态</th>
				<th width="80">操作</th>
				
			</tr>
		</thead> 
		<tbody>
		<{uqcms m="xuq" v="add" c="get_all"}> 	
		<{if $add}> 	
			<{foreach item=i from=$add}>		
			<tr>
				<td><{$i.title}></td>
				<td><{$i.name}></td>
				<td><{$i.goods_guige}> </td> 
				<td>
					<{$i.addtime}>
				</td>
				<td>
					<{$i.tbs}>
				</td> 
				<td>
					<{if $i.tbzt == 0}>投标进行中<{else}>投标已完成<{/if}>
				</td> 
				<td>
					<a href="?m=xuq&a=seller_detail&id=<{$i.id}>" class="view">查看</a>
				</td>
			</tr>
			<{/foreach}>
		<{else}>
			<tr><td colspan="5" class="btm"><div class="nomsg"><i></i><span>您还没添加送货地址~</span></div></td></tr> 
		<{/if}>
		</tbody> 
	</table>
</div> 	 
<{include file="index/footer.html"}> 
<script type="text/javascript"> 
function edit_address(name,url){ 
	ajax_dialog(name,url, 1880); 
} 
// 设为默认 
$(document).on("click",".set_default",function(){ 
	$this = $(this);
	var id = $(this).attr('data-id');
	$.post('member.php?m=address&a=set_default',{id:id},function(result){
		var data = jQuery.parseJSON(result); 
		if(data.error == '0'){
			$.alert('设置成功', function(){
				location.reload();
			});
		}else{
			$.alert(data.msg);
		}
	});
});
// 删除地址
$(document).on("click",".addr_del",function(){ 
	if (!confirm("确认要删除？")) { 
		if(window.event){
			window.event.returnValue = false;
		}else{  
			event.preventDefault();	//for firefox
		}
	}else{
		$this = $(this);
		var id = $this.attr('data-id');
		$.post('member.php?m=address&a=del',{id:id},function(result){
			var data = jQuery.parseJSON(result);  
			if(data.error == '0'){ 
				$.alert('删除成功', function(){
					location.reload();
				});
			}else{
				alert(data.msg);
			}
		});	
	}
});
</script>